Archive

Archive for the ‘HTML / CSS’ Category

Marquee in page title

January 20, 2013 3 comments
<script>
var textDisplay = new Array ("___Welcome to this site___","___This is demo___");
var textCount=2;
var x=0;
var y=0;
var str=textDisplay[0];
y=textDisplay[0].length;

function animate() {
     str=str.substr(str.length-1,str.length)+str.substr(0,str.length-1);
     parent.window.document.title=str;
     setTimeout("animate()",200);
}
animate();
</script>
Categories: HTML / CSS, Javascript

CSS Step Wizard

January 20, 2013 12 comments

The found following code for css Step wizard in http://jsfiddle.net/9CsDr/2/ and copied here

wizard

Read more…

Categories: HTML / CSS

CSS border taking extra space & causing HTML alignment issue?

January 20, 2013 1 comment

We can use outline:1px solid black; but it is not supported in IE 6/7, So we can use following solution

Example1:

.element_name {
  border:1px solid black;
  margin:-1px;
}

Example2:

.element_name {
  border:2px solid black;
  margin:-2px;
}
Categories: HTML / CSS

how to align text vertical center in div with css

January 20, 2013 2 comments
#box {
  height: 90px;
  line-height: 90px;
}
Categories: HTML / CSS

Centering Div

January 20, 2013 2 comments

Use auto as left and right margin to center the element.

Put an element after the floating elements and use clear to put it below them. As it’s not floating, it will affect the size of the outer div.

<div style="margin: 0 auto; background-color: Red; width: 980px;" id="container">
    <br />
    <br />
    <br />
    <br />
    <div style="width: 400px; background-color: Black; float: left;">
        <br />
        <br />
    </div>
    <div style="width: 400px; background-color: Blue; float: left;">
        <br />
        <br />
    </div>
    <div style="clear: both; height: 0; overflow: hidden;"></div>
</div>
Categories: HTML / CSS

Include html files inside another html file

July 23, 2010 Leave a comment

Following is the way of including the html files inside some other html files.

Apache configuration for ssi(server side includes)   ( /etc/apache2/default-server.conf)

<Directory “/srv/www/htdocs”>
//…

Options +Includes
AddType text/html .html .php
AddOutputFilter INCLUDES .html .php

//…
</Directory>

 

index.html

<!–#include file=”header.html”–>
<!–#include virtual=”header.html” –>
<table>
<tbody>
<tr>
<td>content</td>
</tr>
</tbody>
</table>

 

header.html
<table>
<tbody>
<tr>
<td>Header</td>
</tr>
</tbody>
</table>

Categories: HTML / CSS

ZoomIn and ZoomOut of text on webpage

July 23, 2010 Leave a comment

Zoom in/out options would be required in any informative website. Page would contains either article or news or any other text.
Here is the simple way to implement the same.
In this example i restricted minimum font size to 10 and max to 20. You can change as per your requirement.
Read more…

Categories: HTML / CSS, Javascript

HTML Table with thin border

November 19, 2009 1 comment

This might be simple for somebody. This will be helpful for the dudes who are not very strong in HTML/CSS.

If you want to have table with thin border like below

 

 

 

Read more…

Categories: HTML / CSS

Differences between HTML and XHTML

October 22, 2009 Leave a comment
Categories: HTML / CSS, Web

Expand and Collapse

August 20, 2009 2 comments

If you have multiple sections in the page, displaying all the sections looks not good. To overcome this, we can have expand and collapse mechanism. If user expands one section, all the other sections will be collapsed automatically. This whole process will be handled through Javascript. This will works as simple accordion

We are using two images(“plus.jpg” and “minus.jpg”) to get good look for the page. You can get those images here. Please save these images into “images” folder.

Here is the code:
Read more…

Categories: HTML / CSS, Javascript